package cn.edu.scau.cmi.yangzemin.singleton;

public class Marshal {
	private static Marshal[] marshalArray = new Marshal[10];
	private static int index;
	private String name;
	
	private Marshal(String name)
	{
		this.name = name;
	}
	
	public static Marshal getInstance(String name)
	{
		if (index >= 10)
		{
			return null;
		}
		Marshal marshal = new Marshal(name);
		marshalArray[index] = marshal;
		index++;
		return marshal;
	}
	
	public String getName()
	{
		return name;
	}
}
